﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
                    xmlns:a="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
                    xmlns:c="clr-namespace:Lithnet.MetadirectoryServices;assembly=Lithnet.MetadirectoryServices"
                    xmlns:fim="clr-namespace:Microsoft.MetadirectoryServices;assembly=Microsoft.MetadirectoryServicesEx"
                    xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation">

    <DataTemplate  DataType="{x:Type p:AttributeChangeRuleViewModel}">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Label Content="Attribute"
                       Grid.Row="0"
                       Grid.Column="0"
                       Margin="2" />
                <ComboBox ItemsSource="{Binding AllowedAttributes}"
                          SelectedItem="{Binding Attribute, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Grid.Row="0"
                          Grid.Column="1"
                          Margin="2"
                          IsEditable="True" />

                <Label Content="Triggers"
                       Grid.Row="1"
                       Grid.Column="0"
                       Margin="2" />

                <Grid Grid.Row="1"
                      Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                <CheckBox Content="No change is present"
                          IsChecked="{Binding EventNone}"
                          VerticalAlignment="Center"
                          Grid.Row="0"
                          Grid.Column="1"
                          Margin="2" />

                <CheckBox Content="Any change is present"
                          IsChecked="{Binding EventAll}"
                          VerticalAlignment="Center"
                          Grid.Row="1"
                          Grid.Column="1"
                          Margin="2" />

                <CheckBox Content="Add"
                          IsChecked="{Binding EventAdd}"
                          VerticalAlignment="Center"
                          Grid.Row="0"
                          Grid.Column="0"
                          Margin="2" />

                <CheckBox Content="Update"
                          IsChecked="{Binding EventUpdate}"
                          VerticalAlignment="Center"
                          Grid.Row="1"
                          Grid.Column="0"
                          Margin="2" />

                <CheckBox Content="Delete"
                          IsChecked="{Binding EventDelete}"
                          VerticalAlignment="Center"
                          Grid.Row="2"
                          Grid.Column="0"
                          Margin="2" />
                </Grid>
            </Grid>
        </StackPanel>
    </DataTemplate>

</ResourceDictionary>